﻿using Code;
using CSScriptLibrary;
using github.heerheer.card2.Code.Helper.ImageHelper;
using System;
using System.Collections.Generic;
using System.IO;

namespace github.heerheer.card2.Code.ImageHelper
{
    public class ImageDLCManager
    {
        public List<ImageDLC> imageDLCs;

        public void LoadDLCs()
        {
            var Path = AppMain.Common.AppDirectory + "ImageDLC";
            imageDLCs = new List<ImageDLC>();
            try
            {
                foreach (var item in Directory.GetFiles(Path, "*.dlc"))
                {
                    CSScript.Evaluator.LoadCode<ImageDLC>(File.ReadAllText(item));
                }
            }
            catch (Exception)
            {
                //崩溃
            }


        }
    }
}